import axios from '../utils/http'; // 导入http中创建的axios实例
import { Base64 } from '../utils/base';
let baseObj = new Base64()
const base_url = process.env.BASE_API;
const inter_url = '/proxy/cam/proxy/common?api=';
const commonApi = {
  // 红包列表
  getRedList(params) {
    let url = '/red/api/redBag/list'
    return axios.post(`${base_url}${url}`, params);
  },
  // 红包详情
   getRedDetail(params) {
    let url = '/red/api/redBag/detail'
    return axios.post(`${base_url}${url}?bagId=${params.bagId}`, params);
  },
  //  订单列表
    getUserOrder(params) {
    let url = '/red/api/userOrder/list'
    return axios.post(`${base_url}${url}`, params);
  },

   // 订单详情
   getUserOrderDetail(params) {
    let url = '/red/api/userOrder/detail'
    return axios.post(`${base_url}${url}?orderId=${params.orderId}`, params);
  },
      // 下单
   orderApply(params) {
    let url = '/red/api/userOrder/apply'
    return axios.post(`${base_url}${url}`, params);
  },
        // 下单
   wxh5Redirect(params) {
    let url = '/red/api/userAccount/wxh5Redirect'
    return axios.post(`${base_url}${url}`, params);
  },
     wxh5Login(params) {
    let url = '/red/api/userAccount/wxh5Login'
    return axios.post(`${base_url}${url}?wxcode=${params.wxcode}`, params);
  },
  getPayInfo(params) {
    let url = '/red/api/userOrderPay/getPayInfo'
    return axios.post(`${base_url}${url}`, params);
  },



  plateLicense(params) {
    let url = '/proxy/ocr/plateLicense'
    return axios.post(`${base_url}${url}`, params);
  },

}

export default commonApi;
